<!DOCTYPE html>

<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>



		</style>
		<script>
			let timeid = null;

			function displayDiv() {

				let d1 = document.getElementById("d1");
				timeid = setInterval(function() {
					let now = new Date();
					let nowStr = now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate() + " " + now
						.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds();
					d1.innerText = nowStr;
				}, 1000)
			}

			function stopTime() {
				if (timeid) {
					clearInterval(timeid)
				}
			
			}
		</script>

	</head>
	<!--
	 
	     onload 页面加载完成  
	             1 dom节点
	             2 所有的网络请求结束
	   
	   -->
	<body onload="displayDiv()">
		<button onclick="stopTime()">停止</button>


		<div id="d1" style="width: 300px;height: 300px;border: solid 1px red;font-size: 30px;font-weight: 800;">
			09：27：01
		</div>



		<video src="http://wwww.baidu.com/a.mp3"></video>

	</body>
</html>